<template>
  <PageWrapper title="应用功能页">
    <a-button type="primary" @click="enterApp"> 跳转至应用 </a-button>
    <Result
      title="此页面其他功能需要自主开发"
      :subTitle="subTitle"
    >
    </Result>
  </PageWrapper>
</template>

<script lang="tsx" setup>
  import { PageWrapper } from '@/components/Page';
  import { Result } from 'ant-design-vue';

  import { useRouter } from 'vue-router';
  import { unref } from 'vue';
  import { enter } from '@/api/partner';

  const { currentRoute } = useRouter();
  const params = unref(currentRoute).params;
  const subTitle = `当前应用ID: ${params.id}`

  async function enterApp() {
    const res = await enter(params.id);
    window.open(res.url, "_blank");
  }
  
</script>